/*******************************************************************************
 * Copyright (c) 2009 IBM Corporation and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.aseclipse.core.runtime.app
{
    /**
    * Bootstrap type for an application. An IApplication represent executable entry points into an application. 
    * An IApplication can be configured into the Platform's org.aseclipse.osgi.applications extension-point.
    * 
    * Clients may implement this interface.
    */  
    public interface IApplication
    {
        
        /**
        * Starts this application with the given context and returns a result. This method must not exit until 
        * the application is finished and is ready to exit. The content of the context is unchecked and should 
        * conform to the expectations of the application being invoked.
        * Applications can return any object they like. If an Integer is returned it is treated as the program 
        * exit code if Eclipse is exiting.
        * 
        * Note: This method is called by the platform; it is not intended to be called directly by clients.
        */  
        function start(context:IApplicationContext):void;
        
        /***
        * Forces this running application to exit. This method should wait until the running application is 
        * ready to exit. The start(IApplicationContext) should already have exited or should exit very soon 
        * after this method exits.
        */ 
        function stop():void;
    }
}